package com.zretc.news.entity;

public class News {
	private int newsid;
	private String newstitle;
	private String newscontent;
	private String newsdate;// ?这个如果是date,稍微麻烦一点，后续再说
	private int typeid;
	private NewsType type = new NewsType();// 实际应该是这样的

	/**
	 * @return the type
	 */
	public NewsType getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(NewsType type) {
		this.type = type;
	}

	public News(String newstitle, String newscontent, String newsdate, int typeid) {
		this.newstitle = newstitle;
		this.newscontent = newscontent;
		this.newsdate = newsdate;
		this.typeid = typeid;
	}

	public News(String newstitle, String newscontent, int typeid) {
		this.newstitle = newstitle;
		this.newscontent = newscontent;
		this.typeid = typeid;
	}

	public News(int newsid, String newstitle, String newscontent, String newsdate, int typeid) {
		super();
		this.newsid = newsid;
		this.newstitle = newstitle;
		this.newscontent = newscontent;
		this.newsdate = newsdate;
		this.typeid = typeid;
	}

	public News() {
		// TODO Auto-generated constructor stub
	}

	/**
	 * @return the newsid
	 */
	public int getNewsid() {
		return newsid;
	}

	/**
	 * @param newsid the newsid to set
	 */
	public void setNewsid(int newsid) {
		this.newsid = newsid;
	}

	/**
	 * @return the newstitle
	 */
	public String getNewstitle() {
		return newstitle;
	}

	/**
	 * @param newstitle the newstitle to set
	 */
	public void setNewstitle(String newstitle) {
		this.newstitle = newstitle;
	}

	/**
	 * @return the newscontent
	 */
	public String getNewscontent() {
		return newscontent;
	}

	/**
	 * @param newscontent the newscontent to set
	 */
	public void setNewscontent(String newscontent) {
		this.newscontent = newscontent;
	}

	/**
	 * @return the newsdate
	 */
	public String getNewsdate() {
		return newsdate;
	}

	/**
	 * @param newsdate the newsdate to set
	 */
	public void setNewsdate(String newsdate) {
		this.newsdate = newsdate;
	}

	/**
	 * @return the typeid
	 */
	public int getTypeid() {
		return typeid;
	}

	/**
	 * @param typeid the typeid to set
	 */
	public void setTypeid(int typeid) {
		this.typeid = typeid;
		this.type.setTypeid(typeid);
	}

	@Override
	public String toString() {
		return "News [newsid=" + newsid + ", newstitle=" + newstitle + ", newscontent=" + newscontent + ", newsdate="
				+ newsdate + ", typeid=" + typeid + ", type=" + type + "]";
	}

	// 以下赋值是给type对象进行赋值

	/**
	 * @param typename the typename to set
	 */
	public void setTypename(String typename) {
		this.type.setTypename(typename);
	}

	/**
	 * @param typeremark the typeremark to set
	 */
	public void setTyperemark(String typeremark) {
		this.type.setTyperemark(typeremark);
	}

}
